<!DOCTYPE html>
<html>
  <head>
    <title>jQuery WeUI</title>
    <meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>

<meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
"/>

<link rel="stylesheet"  th:href="@{/dist/lib/weui.min.css}" />
<link rel="stylesheet" th:href="@{/dist/css/jquery-weui.min.css}" />
<link rel="stylesheet" th:href="@{/dist/demos/css/demos.css}" />
<script type="text/javascript"  th:src="@{/dist/lib/jquery-2.1.4.js}" ></script>
<script type="text/javascript" th:src="@{/dist/js/jquery-weui.js}" ></script>
<script type="text/javascript" th:src="@{/dist/lib/fastclick.js}" ></script>
<link rel="stylesheet" th:href="@{/adminltecss/userl.css}" />
<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
  <style>
  	.pic{
  		margin: auto;  
position: absolute;  
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;  
  height: 80px;
  width: 80px;
  margin-top: 110px;
  	}
  .content{
  	padding-top: -70px;
  	height: -20px;
  	padding-bottom: -40px;
  }
  	
  		.cusmar{
  		margin-left: 40px;
  	}
  	.header-wai{
  		position: fixed;top:0px; height:60px;background-color: #363436;
  	}
  </style>
  <script type="text/javascript" th:inline="javascript">
	 
  /*<![CDATA[*/
	  
	  	$(function(){
	  		
	  		if(/*[[${exceptionDemo}]]*/==1){
	  			$.alert("用户名或密码错误");
	  		}
	  	});
	  
	  
		 	function submitDemo(){
		 		
		 		var eusername=$("input[name='eusername']").val();
		 		var epassword=$("input[name='epassword']").val();
		 		if(eusername==""){
		 			$.alert("用户名不能为空");
		 			return false;
		 			
		 		}
		 		if(epassword==""){
		 			$.alert("密码不能为空");
		 			return false;
		 		}
		 	
		 		
		 		
		 		  $.post(
		 				"/WBizController/selectBynameAndPassWord",
		 				{
		 					"eusername":eusername,
		 					"epassword":epassword,
		 						
		 				},
		 				function(result){
		 					var simpleResult=result.simpleResult;
		 					
		 					if(simpleResult.code==0){
		 					/*判断是否是第一次登陆  */
		 						
		 						if(result.stat=="0"){
		 						window.location.href="/WBizController/HeadPage?stat="+result.stat+"";
		 						}else{
		 							window.location.href="/WBizController/HeadPage";
		 						}
		 					}else{
		 						$.alert("账号或密码错误，请重新填写。", "");
		 					}
		 					
		 				},
		 				"json"
		 				);  
		 	} 
  
  			function checkUserNaem(){
  				var eusername=$("input[name='eusername']").val();
  				$.post(
  					"/WBizController/selectByUserNameInfo",
  					{
  						"eusername":eusername
  					},
  					function(result){
  						if(result.simpleResult.code==0){
  								$("#img").attr("src",result.imageInfo);
  						}else{
  							
  							$.alert("用户名不存在", "");
  							$("#img").attr("src","/demos/images/avatar.jpg");
  						}
  					},
  					"json"
  					
  				);
  			}
  			/*返回上一级  */
  			function returnDemo(){
  				window.history.back(-1); 
  			}
  			
		 	/*]]>*/
  </script>
  </head>
  <body ontouchstart>
  <div class="weui-tabbar header-wai" style="">
  		<a href="" class="weui-tabbar__item"  id="cusdow">
          <div class="weui-tabbar__icon"></div>
          <p class="weui-tabbar__label" style="font-size: 20px; color: white; line-height: 1px;">
          	<span class="fa fa-angle-left fa-2x" style="color: white; float: left;line-height: 10px;" onclick="returnDemo()"></span>
          	员工登录<span class="fa fa-angle-down fa-2x" style="color: white;float: right; margin-right: 10px;line-height: 10px; " id="down"></span></p>
        </a>
      </div>
  
  
  	<div class="weui-grids" style="margin-top:45px">
  		<div  class="content">
  	

   <img th:src="@{/demos/images/avatar.jpg}" id="img" class="pic"/> 
    <!--  <img src="data:image/jpeg;base64," class="pic"/> -->
   </div>
  		<div class="weui-cells weui-cells_form" style="margin-top: 230px;">
  		
  		
    <div class="weui-cell weui-cell_vcode" style="padding: 20px;">
        <div class="weui-cell__hd">
          <label class="weui-label">账号</label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="tel" name="eusername" placeholder="请输入账号" onblur="checkUserNaem()"/>
        </div>
        
      </div>
  	<div class="weui-cell weui-cell_vcode"   style="padding: 20px;">
        <div class="weui-cell__hd">
          <label class="weui-label">密码</label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="password" name="epassword" placeholder="请输入密码"/>
        </div>
        
      </div>
    
     </div>
       <div class='demos-content-padded'>
       <!-- th:href="sc-mainpage.html" -->
       	 <a  href="javascript:submitDemo()" class="weui-btn weui-btn_primary" >登录</a>
       	</div>
      </div>
  	
  	<div class="weui-footer weui-footer_fixed-bottom">
        <p class="weui-footer__links">
          <a th:href="sc-changepassword.html" class="weui-footer__link">忘记密码&nbsp;&nbsp;|&nbsp;&nbsp;其他选项</a>
        </p>
        <p class="weui-footer__text">登录即代表阅读并同意服务条款</p>
      </div>
  	
  	
  	</body>
  </html>